#include "mainwidget.h"
#include "ui_mainwidget.h"

MainWidget::MainWidget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::MainWidget)
{
    ui->setupUi(this);
    loginwidget = new LoginWidget;
    studentwidget = new StudentWidget;
    teacherwidget = new TeacherWidget;
    managerwidget = new ManagerWidget;
    stackLayout = new QStackedLayout;

    /*
    stackLayout->addWidget(loginwidget);
    stackLayout->addWidget(studentwidget);
    stackLayout->addWidget(teacherwidget);
    stackLayout->addWidget(managerwidget);
    setLayout(stackLayout);

    connect(loginwidget, &LoginWidget::display, stackLayout, &QStackedLayout::setCurrentIndex);
    connect(studentwidget, &StudentWidget::display, stackLayout, &QStackedLayout::setCurrentIndex);
    connect(teacherwidget, &TeacherWidget::display, stackLayout, &QStackedLayout::setCurrentIndex);
    connect(managerwidget, &ManagerWidget::display, stackLayout, &QStackedLayout::setCurrentIndex);
    //connect(registerwidget, &LoginWidget::display, stackLayout, &QStackedLayout::setCurrentIndex);
    */
}

MainWidget::~MainWidget()
{
    delete ui;
}
